import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '溶剂名称',
    align: "center",
    dataIndex: 'name',
    width: 100
  },
  {
    title: '类型',
    align: "center",
    dataIndex: 'type',
    width: 100
  },
  {
    title: '批次',
    align: "center",
    dataIndex: 'batch',
    width: 110
  },
  {
    title: '库存(L)',
    align: "center",
    dataIndex: 'stock',
    width: 100
  },
  {
    title: '沸点(℃)',
    align: "center",
    dataIndex: 'boilingPoint',
    width: 90
  },
  {
    title: '自燃点(℃)',
    align: "center",
    dataIndex: 'ignitionPoint',
    width: 100
  },
  {
    title: '气体密度(kg/m3)',
    align: "center",
    dataIndex: 'gasDensity',
    width: 145
  },
  {
    title: '临界温度(℃)',
    align: "center",
    dataIndex: 'criticalTemp',
    width: 100
  },
  {
    title: '临界压力(℃)',
    align: "center",
    dataIndex: 'criticalPressure',
    width: 100
  },
  {
    title: '临界密度(kg/m3)',
    align: "center",
    dataIndex: 'criticalDensity',
    width: 145
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '溶剂名称',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入溶剂名称!'},
             ];
    },
  },
  {
    label: '类型',
    field: 'type',
    component: 'Input',
  },
  {
    label: '批次',
    field: 'batch',
    component: 'Input',
  },
  {
    label: '库存（L）',
    field: 'stock',
    component: 'InputNumber',
  },
  {
    label: '沸点（℃）',
    field: 'boilingPoint',
    component: 'InputNumber',
  },
  {
    label: '自燃点（℃）',
    field: 'ignitionPoint',
    component: 'InputNumber',
  },
  {
    label: '气体密度（kg/m3）',
    field: 'gasDensity',
    component: 'InputNumber',
  },
  {
    label: '临界温度（℃）',
    field: 'criticalTemp',
    component: 'InputNumber',
  },
  {
    label: '临界压力（℃）',
    field: 'criticalPressure',
    component: 'InputNumber',
  },
  {
    label: '临界密度（kg/m3）',
    field: 'criticalDensity',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
